<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    {$LOAD_STYLE.top|raw}
</head>
	<body class="pear-container">
		<div class="layui-card">
			<div class="layui-card-body">
				<form class="layui-form layui-form-pane" action="">
					<div class="layui-form-item">
                        
                        <div class="layui-form-item layui-inline">
                       <button class="pear-btn pear-btn-md pear-btn-primary" lay-submit lay-filter="query">
                           <i class="layui-icon layui-icon-search"></i>
                           查询
                       </button>
                       <button type="reset" class="pear-btn pear-btn-md">
                           <i class="layui-icon layui-icon-refresh"></i>
                           重置
                       </button>
                       </div>
                    </div>
				</form>
			</div>
		</div>
		<div class="layui-card">
			<div class="layui-card-body">
				<table id="dataTable" lay-filter="dataTable"></table>
			</div>
		</div>

		<script type="text/html" id="toolbar">
			<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
		        <i class="layui-icon layui-icon-add-1"></i>
		        新增
			</button>
			<button class="pear-btn pear-btn-danger pear-btn-md" lay-event="batchRemove">
		        <i class="layui-icon layui-icon-delete"></i>
		        删除
		    </button>
			<button class="pear-btn pear-btn-ext1 pear-btn-md" lay-event="jump" url="{:U('customer.main/index')}" poptitle="客户管理">
			    <i class="layui-icon layui-icon-table"></i>
			    客户管理
			</button>
		</script>

        
               <script type="text/html" id="status">
                   <input type="checkbox" name="status" value="{{d.id}}" lay-skin="switch" lay-text="启用|禁用" lay-filter="status" {{# if(d.status==1){ }} checked {{# } }}>
               </script>

		<script type="text/html" id="options">
		<div class="layui-options">
			<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i class="layui-icon layui-icon-edit"></i></button>
		    <button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i class="layui-icon layui-icon-delete"></i></button>
		</div>
		</script>
        <script>
        layui.use(['jquery','common','mycomm'], function() {
            let $ = layui.jquery;
			let common = layui.common;
			let mycomm = layui.mycomm;
            let MODULE_PATH = "{$MODULE_PATH}";
            
            let cols = [
                [{
                        type: 'checkbox'
                    },{
                       field: "id",
                       title: "ID",
					   width: 80,
                       unresize: "true",
                       align: "center"
                   }, {
                       field: "name",
                       title: "名称",
                       unresize: "true",
                       align: "center"
                   }, {
                       field: "exp",
                       title: "等级指数",
					   width: 100,
                       unresize: "true",
                       align: "center"
                   }, {
                       field: "cards",
                       title: "累计寄色卡数",
					   width: 120,
                       unresize: "true",
                       align: "center"
                   }, {
                       field: "deal_count",
                       title: "升级条件成交次数",
                       unresize: "true",
                       align: "center"
                   }, {
                       field: "deal_total",
                       title: "升级条件成交金额",
                       unresize: "true",
                       align: "center"
                   }, {
                       field: "status",
                       title: "状态",
                       unresize: "true",
                       align: "center",
                       templet:"#status"
                   }, {
                        title: '操作',
                        toolbar: '#options',
                        unresize: true,
                        align: 'center',
                        width:180,
                    }
                ]
            ]

            mycomm.tableInit('{$controller_title}',MODULE_PATH,cols);

        })
    </script>
	{$LOAD_STYLE.bottom|raw}
	</body>
</html>
